package org.classdef.analyzer.info.constant;

/**
 * 
 * int类型常量信息
 *
 */
public class IntInfo extends ConstantInfo {

	private int value;

	public IntInfo(short tag, int value) {
		super(tag);
		this.value = value;
	}

	@Override
	public Object getValue() {
		StringBuilder sb = new StringBuilder();
		sb.append("{");
		sb.append("\"class\":\"").append(Integer.class.getName()).append("\"");
		sb.append(",\"value\":").append(value);
		sb.append("}");
		return sb.toString();
	}

	/*
	 * （非 Javadoc）
	 * 
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append("{");
		sb.append("\"tag\":").append(tag);
		sb.append(",\"value\":").append(value);
		sb.append("}");
		return sb.toString();
	}
}